package Vista;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.GroupLayout;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JSeparator;


import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


public class Vmenu extends javax.swing.JFrame {
	private JMenuBar jMenuBar1;
	private AbstractAction abstractAction3;
	private AbstractAction listarepro;
	private JMenuItem itemlistrepro;
	private AbstractAction listarapro;
	private JMenuItem itemlistapro;
	private AbstractAction aplicare;
	private AbstractAction abstractAction1;
	private JMenuItem itemaplicareva;
	private AbstractAction abstractAction2;
	private JMenuItem itemlistnotaf;
	private AbstractAction lisced;
	private JMenuItem itemlistced;
	private AbstractAction gest;
	private JSeparator jSeparator3;
	private JSeparator jSeparator7;
	private JSeparator jSeparator2;
	private JSeparator jSeparator1;
	private JMenuItem itemgestest;
	private JMenuItem itemAsignar;
	private JMenu jmenusecc;
	private JMenu jmenuest;
	private JMenu jmenuprofesor;

	/**
	* Auto-generated main method to display this JFrame
	*/

	public Vmenu() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			GroupLayout thisLayout = new GroupLayout((JComponent)getContentPane());
			getContentPane().setLayout(thisLayout);
			thisLayout.setHorizontalGroup(thisLayout.createParallelGroup());
			thisLayout.setVerticalGroup(thisLayout.createParallelGroup());
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Proyecto Laboratorio I");
			this.setFont(new java.awt.Font("WenQuanYi Zen Hei Mono",3,12));
			{
				jMenuBar1 = new JMenuBar();
				setJMenuBar(jMenuBar1);
				{
					jmenuprofesor = new JMenu();
					jMenuBar1.add(jmenuprofesor);
					jmenuprofesor.setText("Profesor");
					{
						itemAsignar = new JMenuItem();
						jmenuprofesor.add(itemAsignar);
						itemAsignar.setText("itemAsignar");
						itemAsignar.setAction(getAbstractAction1());
						itemAsignar.add(getJSeparator3());
					}
				}
				{
					jmenuest = new JMenu();
					jMenuBar1.add(jmenuest);
					jmenuest.setText("Estudiante");
					{
						itemgestest = new JMenuItem();
						jmenuest.add(itemgestest);
						itemgestest.setText("itemgestest");
						itemgestest.setAction(getGest());
						itemgestest.add(getJSeparator1());
						itemgestest.add(getJSeparator7());
					}
					{
						itemaplicareva = new JMenuItem();
						jmenuest.add(itemaplicareva);
						itemaplicareva.setText("itemaplicareva");
						itemaplicareva.setAction(getAplicare());
					}
				}
				{
					jmenusecc = new JMenu();
					jMenuBar1.add(jmenusecc);
					jmenusecc.setText("Seccion");
					{
						itemlistced = new JMenuItem();
						jmenusecc.add(itemlistced);
						itemlistced.setText("itemlistced");
						itemlistced.setAction(getLisced());
						itemlistced.add(getJSeparator2());
					}
					{
						itemlistnotaf = new JMenuItem();
						jmenusecc.add(itemlistnotaf);
						itemlistnotaf.setText("itemlistnotaf");
						itemlistnotaf.setAction(getAbstractAction2());
					}
					{
						itemlistapro = new JMenuItem();
						jmenusecc.add(itemlistapro);
						itemlistapro.setText("itemlistapro");
						itemlistapro.setAction(getListarapro());
					}
					{
						itemlistrepro = new JMenuItem();
						jmenusecc.add(itemlistrepro);
						itemlistrepro.setText("itemlistrepro");
						itemlistrepro.setAction(getListarepro());
					}
					
				}
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	private AbstractAction getAbstractAction1() {
		
		if(abstractAction1 == null) {
			abstractAction1 = new AbstractAction("Asignar", null) {
				public void actionPerformed(ActionEvent evt) {
					Vprofesor v = new Vprofesor();
					v.setLocation(75, 75);
					v.setResizable(false);
					v.setSize(400,300);
					v.setVisible(true);
					v.txtcedula.requestFocus();
			
				
				}
				
			};
		}
		return abstractAction1;
	}
	
	private AbstractAction getGest() {
		if(gest == null) {
			gest = new AbstractAction("Gestionar Estudiante", null) {
				public void actionPerformed(ActionEvent evt) {
					Vestudiante est = new Vestudiante();
					est.txtced.requestFocus();
					est.setVisible(true);
					est.setLocation(50, 50);
					est.setResizable(false);
					est.btnbuscar.setEnabled(true);
					est.btnret.setEnabled(false);
					est.txtnombre.setEnabled(true);
					est.txtapellido.setEnabled(true);
				}
			};
		}
		return gest;
	}
	
	private AbstractAction getLisced() {
		if(lisced == null) {
			lisced = new AbstractAction("Listar Estudiantes por cedula", null) {
				public void actionPerformed(ActionEvent evt) {
					Vreportes vced = new Vreportes();
					vced.setVisible(true);
					vced.setLocation(50, 50);
					vced.setResizable(false);
					vced.btngenerar.setEnabled(true);
				}
			};
		}
		return lisced;
	}
	
	private AbstractAction getAbstractAction2() {
		if(abstractAction2 == null) {
			abstractAction2 = new AbstractAction("Listar Estudiante por Nota Final", null) {
				public void actionPerformed(ActionEvent evt) {
					Vreportes vnof = new Vreportes();
					
				}
			};
		}
		return abstractAction2;
	}
	
	private AbstractAction getAplicare() {
		if(aplicare == null) {
			aplicare = new AbstractAction("Aplicar Evaluacion", null) {
				public void actionPerformed(ActionEvent evt) {
					Vaplicarevaluacion apli = new Vaplicarevaluacion();
					apli.setVisible(true);
					apli.setLocation(200, 200);
					apli.setResizable(false);
					apli.btnapli.setEnabled(true);
				}
			};
		}
		return aplicare;
	}
	
	private AbstractAction getListarapro() {
		if(listarapro == null) {
			listarapro = new AbstractAction("Listar Estudiantes Aprobados", null) {
				public void actionPerformed(ActionEvent evt) {
					Vreportes va = new Vreportes();
				}
			};
		}
		return listarapro;
	}
	
	private AbstractAction getListarepro() {
		if(listarepro == null) {
			listarepro = new AbstractAction("Listar Estudiantes Reprobados", null) {
				public void actionPerformed(ActionEvent evt) {
					Vreportes vr = new Vreportes(); 
				}
			};
		}
		return listarepro;
	}
	
	private AbstractAction getAbstractAction3() {
		if(abstractAction3 == null) {
			abstractAction3 = new AbstractAction("Promedio de la Seccion", null) {
				public void actionPerformed(ActionEvent evt) {
				}
			};
		}
		return abstractAction3;
	}
	
	private JSeparator getJSeparator1() {
		if(jSeparator1 == null) {
			jSeparator1 = new JSeparator();
		}
		return jSeparator1;
	}
	
	private JSeparator getJSeparator2() {
		if(jSeparator2 == null) {
			jSeparator2 = new JSeparator();
		}
		return jSeparator2;
	}

	private JSeparator getJSeparator7() {
		if(jSeparator7 == null) {
			jSeparator7 = new JSeparator();
		}
		return jSeparator7;
	}
	
	private JSeparator getJSeparator3() {
		if(jSeparator3 == null) {
			jSeparator3 = new JSeparator();
		}
		return jSeparator3;
	}

}
